using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._BusinessAnalystTools._Modeling
{
    /// <summary>
    /// <para>Huff Model</para>
    /// <para>Creates a probability surface to predict the sales potential of an area based on distance and an attractiveness factor.</para>
    /// <para>创建概率曲面，以根据距离和吸引力因子预测区域的销售潜力。</para>
    /// </summary>    
    [DisplayName("Huff Model")]
    public class HuffModel : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public HuffModel()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_facility_features">
        /// <para>Input Facility Features</para>
        /// <para>An input point feature layer representing existing facility locations. It is the first feature from the layer or the feature selected when a selection is available.</para>
        /// <para>表示现有设施点位置的输入点要素图层。它是图层中的第一个要素，或者是选择可用时所选要素。</para>
        /// </param>
        /// <param name="_facility_id_field">
        /// <para>Facility ID Field</para>
        /// <para>A unique ID field for existing facilities.</para>
        /// <para>现有设施点的唯一 ID 字段。</para>
        /// </param>
        /// <param name="_in_candidate_features">
        /// <para>Input Candidate Features</para>
        /// <para>An input point feature layer representing new candidate facility locations. It is the first feature from the layer or the feature selected when a selection is available.</para>
        /// <para>表示新候选设施点位置的输入点要素图层。它是图层中的第一个要素，或者是选择可用时所选要素。</para>
        /// </param>
        /// <param name="_candidate_id_field">
        /// <para>Candidate ID Field</para>
        /// <para>A unique ID field for candidate facilities.</para>
        /// <para>候选设施点的唯一 ID 字段。</para>
        /// </param>
        /// <param name="_in_sales_potential_features">
        /// <para>Input Sales Potential Features</para>
        /// <para>An input point or polygon feature layer used to calculate the sales potential. It is either all features from a layer or only selected features when a selection is available.</para>
        /// <para>用于计算销售潜力的输入点或面要素图层。它要么是图层中的所有要素，要么是仅选择的要素（如果选择可用）。</para>
        /// </param>
        /// <param name="_sales_potential_id_field">
        /// <para>Sales Potential ID Field</para>
        /// <para>A unique ID field for sales potential features.</para>
        /// <para>销售潜力要素的唯一 ID 字段。</para>
        /// </param>
        /// <param name="_sales_potential_field">
        /// <para>Sales Potential Field</para>
        /// <para>The field containing the values that will be used to calculate the sales potential.</para>
        /// <para>包含将用于计算销售潜力的值的字段。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output feature Class</para>
        /// <para>The output feature class that will contain the tool results representing the probability of sales.</para>
        /// <para>输出要素类，其中包含表示销售概率的工具结果。</para>
        /// </param>
        /// <param name="_attractiveness_variables">
        /// <para>Attractiveness Variables</para>
        /// <para><xdoc>
        ///   <para>The attribute fields that indicate the attractiveness of each competitor. In many cases, the size of the facility is used as a substitute for attractiveness and will be a multivalue table.</para>
        ///   <para>An additional attractiveness variable is needed. The attractiveness field must be present in the existing facilities (competitors) and the candidate facilities layer.</para>
        ///   <bulletList>
        ///     <bullet_item>Existing Facilities Value—Numeric field in the Input Facility Features parameter layer that represents attractiveness.</bullet_item><para/>
        ///     <bullet_item>Candidates Location Value—Numeric Field in the Input Candidate Features parameter layer that matches the attractiveness value from the Input Facility Features parameter layer. Distance does not require a matching field.</bullet_item><para/>
        ///     <bullet_item>Exponent—The value that determines how much of a factor the variable is to the attractiveness value. The default value is 1.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>表示每个竞争对手的吸引力的属性字段。在许多情况下，设施的大小被用作吸引力的替代品，并且将是一个多值表。</para>
        ///   <para>需要一个额外的吸引力变量。吸引力字段必须存在于现有设施（竞争对手）和候选设施层中。</para>
        ///   <bulletList>
        ///     <bullet_item>现有设施值 - 输入设施要素参数图层中表示吸引力的数值字段。</bullet_item><para/>
        ///     <bullet_item>候选位置值 - 输入候选要素参数图层中与输入设施要素参数图层中的吸引力值匹配的数值字段。距离不需要匹配字段。</bullet_item><para/>
        ///     <bullet_item>指数 - 确定变量对吸引力值的因子影响的值。默认值为 1。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_distance_exponent">
        /// <para>Distance Exponent</para>
        /// <para>The distance exponent is generally a negative number because attractiveness decreases when distance increases. The default value is -1.5.</para>
        /// <para>距离指数通常是负数，因为吸引力会随着距离的增加而降低。默认值为 -1.5。</para>
        /// </param>
        public HuffModel(object _in_facility_features, object _facility_id_field, object _in_candidate_features, object _candidate_id_field, object _in_sales_potential_features, object _sales_potential_id_field, object _sales_potential_field, object _out_feature_class, object _attractiveness_variables, double _distance_exponent)
        {
            this._in_facility_features = _in_facility_features;
            this._facility_id_field = _facility_id_field;
            this._in_candidate_features = _in_candidate_features;
            this._candidate_id_field = _candidate_id_field;
            this._in_sales_potential_features = _in_sales_potential_features;
            this._sales_potential_id_field = _sales_potential_id_field;
            this._sales_potential_field = _sales_potential_field;
            this._out_feature_class = _out_feature_class;
            this._attractiveness_variables = _attractiveness_variables;
            this._distance_exponent = _distance_exponent;
        }
        public override string ToolboxName => "Business Analyst Tools";

        public override string ToolName => "Huff Model";

        public override string CallName => "ba.HuffModel";

        public override List<string> AcceptEnvironments => ["baDataSource", "baNetworkSource", "workspace"];

        public override object[] ParameterInfo => [_in_facility_features, _facility_id_field, _in_candidate_features, _candidate_id_field, _in_sales_potential_features, _sales_potential_id_field, _sales_potential_field, _out_feature_class, _attractiveness_variables, _distance_exponent, _out_predicted_sales, _distance_type, _distance_units, _out_distance_matrix, _travel_direction.GetGPValue(), _time_of_day, _time_zone.GetGPValue()];

        /// <summary>
        /// <para>Input Facility Features</para>
        /// <para>An input point feature layer representing existing facility locations. It is the first feature from the layer or the feature selected when a selection is available.</para>
        /// <para>表示现有设施点位置的输入点要素图层。它是图层中的第一个要素，或者是选择可用时所选要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Facility Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_facility_features { get; set; }


        /// <summary>
        /// <para>Facility ID Field</para>
        /// <para>A unique ID field for existing facilities.</para>
        /// <para>现有设施点的唯一 ID 字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Facility ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _facility_id_field { get; set; }


        /// <summary>
        /// <para>Input Candidate Features</para>
        /// <para>An input point feature layer representing new candidate facility locations. It is the first feature from the layer or the feature selected when a selection is available.</para>
        /// <para>表示新候选设施点位置的输入点要素图层。它是图层中的第一个要素，或者是选择可用时所选要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Candidate Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_candidate_features { get; set; }


        /// <summary>
        /// <para>Candidate ID Field</para>
        /// <para>A unique ID field for candidate facilities.</para>
        /// <para>候选设施点的唯一 ID 字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Candidate ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _candidate_id_field { get; set; }


        /// <summary>
        /// <para>Input Sales Potential Features</para>
        /// <para>An input point or polygon feature layer used to calculate the sales potential. It is either all features from a layer or only selected features when a selection is available.</para>
        /// <para>用于计算销售潜力的输入点或面要素图层。它要么是图层中的所有要素，要么是仅选择的要素（如果选择可用）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Sales Potential Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_sales_potential_features { get; set; }


        /// <summary>
        /// <para>Sales Potential ID Field</para>
        /// <para>A unique ID field for sales potential features.</para>
        /// <para>销售潜力要素的唯一 ID 字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sales Potential ID Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _sales_potential_id_field { get; set; }


        /// <summary>
        /// <para>Sales Potential Field</para>
        /// <para>The field containing the values that will be used to calculate the sales potential.</para>
        /// <para>包含将用于计算销售潜力的值的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Sales Potential Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _sales_potential_field { get; set; }


        /// <summary>
        /// <para>Output feature Class</para>
        /// <para>The output feature class that will contain the tool results representing the probability of sales.</para>
        /// <para>输出要素类，其中包含表示销售概率的工具结果。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Attractiveness Variables</para>
        /// <para><xdoc>
        ///   <para>The attribute fields that indicate the attractiveness of each competitor. In many cases, the size of the facility is used as a substitute for attractiveness and will be a multivalue table.</para>
        ///   <para>An additional attractiveness variable is needed. The attractiveness field must be present in the existing facilities (competitors) and the candidate facilities layer.</para>
        ///   <bulletList>
        ///     <bullet_item>Existing Facilities Value—Numeric field in the Input Facility Features parameter layer that represents attractiveness.</bullet_item><para/>
        ///     <bullet_item>Candidates Location Value—Numeric Field in the Input Candidate Features parameter layer that matches the attractiveness value from the Input Facility Features parameter layer. Distance does not require a matching field.</bullet_item><para/>
        ///     <bullet_item>Exponent—The value that determines how much of a factor the variable is to the attractiveness value. The default value is 1.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>表示每个竞争对手的吸引力的属性字段。在许多情况下，设施的大小被用作吸引力的替代品，并且将是一个多值表。</para>
        ///   <para>需要一个额外的吸引力变量。吸引力字段必须存在于现有设施（竞争对手）和候选设施层中。</para>
        ///   <bulletList>
        ///     <bullet_item>现有设施值 - 输入设施要素参数图层中表示吸引力的数值字段。</bullet_item><para/>
        ///     <bullet_item>候选位置值 - 输入候选要素参数图层中与输入设施要素参数图层中的吸引力值匹配的数值字段。距离不需要匹配字段。</bullet_item><para/>
        ///     <bullet_item>指数 - 确定变量对吸引力值的因子影响的值。默认值为 1。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attractiveness Variables")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _attractiveness_variables { get; set; }


        /// <summary>
        /// <para>Distance Exponent</para>
        /// <para>The distance exponent is generally a negative number because attractiveness decreases when distance increases. The default value is -1.5.</para>
        /// <para>距离指数通常是负数，因为吸引力会随着距离的增加而降低。默认值为 -1.5。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Exponent")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public double _distance_exponent { get; set; }


        /// <summary>
        /// <para>Predicted Sales</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Predicted Sales")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public double? _out_predicted_sales { get; set; }


        /// <summary>
        /// <para>Distance Type</para>
        /// <para>The type of distance, based on method of travel, that will be used. The default value is Straight Line.</para>
        /// <para>将使用的距离类型，基于旅行方式。默认值为 Straight Line。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _distance_type { get; set; } = null;


        /// <summary>
        /// <para>Distance Units</para>
        /// <para>The distance-measuring units that will be used when calculating distance.</para>
        /// <para>计算距离时将使用的距离测量单位。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Units")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _distance_units { get; set; } = null;


        /// <summary>
        /// <para>Output Distance Matrix</para>
        /// <para>The name and location of the matrix table of distance calculations. The IDs for the Input Facilitates Features and Input Candidate Features parameters must be unique.</para>
        /// <para>距离计算矩阵表的名称和位置。输入促进要素和输入候选要素参数的 ID 必须是唯一的。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Distance Matrix")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_distance_matrix { get; set; } = null;


        /// <summary>
        /// <para>Travel Direction</para>
        /// <para><xdoc>
        ///   <para>Specifies the direction of travel that will be used between stores and sales potential features.</para>
        ///   <bulletList>
        ///     <bullet_item>Toward Stores—The direction of travel will be from sales potential features to stores. This is the default.</bullet_item><para/>
        ///     <bullet_item>Away from Stores—The direction of travel will be from stores to sales potential features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将在商店和潜在销售要素之间使用的行进方向。</para>
        ///   <bulletList>
        ///     <bullet_item>面向商店 - 行进方向将从销售潜在功能到商店。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>远离商店 - 行进方向将从商店到销售潜在功能。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Travel Direction")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _travel_direction_value _travel_direction { get; set; } = _travel_direction_value._TOWARD_STORES;

        public enum _travel_direction_value
        {
            /// <summary>
            /// <para>Toward Stores</para>
            /// <para>Toward Stores—The direction of travel will be from sales potential features to stores. This is the default.</para>
            /// <para>面向商店 - 行进方向将从销售潜在功能到商店。这是默认设置。</para>
            /// </summary>
            [Description("Toward Stores")]
            [GPEnumValue("TOWARD_STORES")]
            _TOWARD_STORES,

            /// <summary>
            /// <para>Away from Stores</para>
            /// <para>Away from Stores—The direction of travel will be from stores to sales potential features.</para>
            /// <para>远离商店 - 行进方向将从商店到销售潜在功能。</para>
            /// </summary>
            [Description("Away from Stores")]
            [GPEnumValue("AWAY_FROM_STORES")]
            _AWAY_FROM_STORES,

        }

        /// <summary>
        /// <para>Time of Day</para>
        /// <para>The time and date that will be used when calculating distance.</para>
        /// <para>计算距离时将使用的时间和日期。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time of Day")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_of_day { get; set; } = null;


        /// <summary>
        /// <para>Time Zone</para>
        /// <para><xdoc>
        ///   <para>Specifies the time zone that will be used for the Time of Day parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>Time Zone at Location—The time zone in which the territories are located will be used. This is the default.</bullet_item><para/>
        ///     <bullet_item>UTC—Coordinated universal time (UTC) will be used.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将用于“时间”参数的时区。</para>
        ///   <bulletList>
        ///     <bullet_item>位置时区—将使用区域所在的时区。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>UTC—将使用协调世界时 （UTC）。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Zone")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _time_zone_value _time_zone { get; set; } = _time_zone_value._TIME_ZONE_AT_LOCATION;

        public enum _time_zone_value
        {
            /// <summary>
            /// <para>UTC</para>
            /// <para>UTC—Coordinated universal time (UTC) will be used.</para>
            /// <para>UTC—将使用协调世界时 （UTC）。</para>
            /// </summary>
            [Description("UTC")]
            [GPEnumValue("UTC")]
            _UTC,

            /// <summary>
            /// <para>Time Zone at Location</para>
            /// <para>Time Zone at Location—The time zone in which the territories are located will be used. This is the default.</para>
            /// <para>位置时区—将使用区域所在的时区。这是默认设置。</para>
            /// </summary>
            [Description("Time Zone at Location")]
            [GPEnumValue("TIME_ZONE_AT_LOCATION")]
            _TIME_ZONE_AT_LOCATION,

        }

        public HuffModel SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}